home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998…eptember: Technology Seed / September 98 ADC Seed CD.toast / FireWire 1.1 DR2 SDK / Source / OpenTransport / Interfaces / OpenTptPCISupport.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-15  |  4.0 KB  |  124 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        OpenTptPCISupport.h
  3.  
  4.     Contains:    File to include everything you need to declare a module
  5.  
  6.     Copyright:    © 1993-1996 by Apple Computer, Inc., all rights reserved.
  7.  
  8.     Change History (most recent first):
  9.  
  10.        <FW3>     6/27/96    ES        Took out lines that should have been deleted for release disk.
  11.          <3>     9/15/95    mjq        Make sure release disk includes Devices.h, not NewDevices.h
  12.          <2>     9/05/95    mjq        • Rename OpenTptDev.h to OpenTptCommon.h
  13.          <1>     7/31/95    mjq        • Started over from OpenTransport project
  14.  
  15.     To Do:
  16.  
  17. */
  18.  
  19. #ifndef __OPENTPTPCISUPPORT__
  20. #define __OPENTPTPCISUPPORT__
  21.  
  22. #ifndef __OPENTPTCOMMON__
  23. #include <OpenTptCommon.h>
  24. #endif
  25. #ifndef __DEVICES__    
  26. //zzz#include <NewDevices.h>            /* this line deleted for release disk */
  27. //zzz#if 0                            /* this line deleted for release disk */
  28. #include <Devices.h>
  29. //zzz#endif                            /* this line deleted for release disk */
  30. #endif
  31.  
  32. #if PRAGMA_ALIGN_SUPPORTED
  33. #pragma options align=mac68k
  34. #endif
  35.  
  36. /*******************************************************************************
  37. ** This is the cookie that is passed to your STREAM Module
  38. ********************************************************************************/
  39.  
  40. struct OTPCIInfo
  41. {
  42.     RegEntryID            fTheID;
  43.     void*                fConfigurationInfo;
  44.     size_t                fConfigurationLength;
  45. };
  46.  
  47. typedef struct OTPCIInfo OTPCIInfo;
  48.  
  49. /*******************************************************************************
  50. ** PCI Card support
  51. ********************************************************************************/
  52. /*
  53.  * All PCI card modules should have the following bits set in their
  54.  * install_info structure:
  55.  * kOTModIsDriver.
  56.  * 
  57.  * They should NEVER have the kOTModPushAlways or the kOTModIsModule
  58.  * flags set.
  59.  *
  60.  * The kOTModIsLowerMux bits should be set if the driver is a lower
  61.  * multiplexor, although Open Transport does nothing with the information
  62.  * today.
  63.  *
  64.  * The kOTModUpperIsDLPI bit should be set if the driver uses the DLPI message
  65.  * specification.  The kOTModUpperIsTPI bit should be set if the driver uses
  66.  * the TPI message specification.
  67.  */
  68.  
  69.  /*    -------------------------------------------------------------------------
  70.     Macro to put together the driverServices.service[x].serviceType field
  71.     
  72.     // xxxxxddd dddddddd ffffffff xxxxxxTD
  73.     //
  74.     // where "d" is the device type for Open Transport,
  75.     // the lower two bits are whether the driver is TPI or DLPI,
  76.     // and the "f" bits are the framing option flags.
  77.     // and all other bits should be 0
  78.     ------------------------------------------------------------------------- */
  79.  
  80. #define OTPCIServiceType(devType, framingFlags, isTPI, isDLPI)    \
  81.     ((devType << 16) | (((framingFlags) & 0xff) << 8) | (isTPI ? 2 : 0) | (isDLPI ? 1 : 0 ))
  82.  
  83.  /*    -------------------------------------------------------------------------
  84.     Typedef for the ValidateHardware function.  This function will be
  85.     called only once, at system boot time, before installing your driver
  86.     into the Open Transport module registry.
  87.     The param pointer will is a RegEntryIDPtr - don't be changing the
  88.     values there!
  89.     ------------------------------------------------------------------------- */
  90.  
  91. typedef OTResult    (* _CDECL ValidateHardwareProcPtr)(OTPCIInfo* param);
  92.  
  93. enum
  94. {
  95.     kOTPCINoErrorStayLoaded        = 1
  96. };
  97.  
  98. /*    -------------------------------------------------------------------------
  99.     Some descriptors we use - these should eventually show up
  100.     in system header files somewhere.
  101.     ------------------------------------------------------------------------- */
  102.  
  103. #define kDescriptorProperty        "driver-descriptor"
  104. #define kDriverProperty            "driver,AAPL,MacOS,PowerPC"
  105. #define kDriverPtrProperty        "driver-ptr"
  106. #define kSlotProperty            "AAPL,slot-name"
  107.  
  108. /*    -------------------------------------------------------------------------
  109.     Maximum # of services support by Open Transport.  If your module
  110.     exports more than this # of services, Open Transport will not be
  111.     able to use the module.
  112.     ------------------------------------------------------------------------- */
  113.  
  114. enum
  115. {
  116.     kMaxServices                = 20
  117. };
  118.  
  119. #if PRAGMA_ALIGN_SUPPORTED
  120. #pragma options align=reset
  121. #endif
  122.  
  123. #endif    /* __OPENTPTPCISUPPORT__ */
  124.